#include "wijiwindow.h"
#include "WijiUi.h"
#include "WijiSettings.h"
#include <QtGui/QMainWindow>
#include <QtWebKit>
#include <QAction>
#include <QtDebug>
#include <QDialog>
WijiWindow::WijiWindow(QWidget *parent)
    : QMainWindow(parent)
{

}
void WijiWindow::init() {
    Qt::WindowFlags flags = 0;
    WijiSettings* ws = WijiSettings::getSelf();
    if (ws->getValue("chromeless").toBool() == true) {
        qDebug() << "Window is frameless.";
        flags |= Qt::FramelessWindowHint;
        //flags |= Qt::WindowTitleHint;
        this->setWindowFlags(flags);
    }
    WijiUi::init(this);
}
void WijiWindow::keyPressEvent(QKeyEvent *event) {
    if (event->key() == Qt::Key_Escape) {
       ui.windowCloseRequested();
    }
}
WijiWindow::~WijiWindow()
{

}
